<template>
  <Portlet title="服务评价" >
    <el-form label-position="left" label-width="120px">
      <el-row :gutter="15">
      <el-col :span="24">
        <el-form-item label="服务评价：">
          <el-rate disabled v-model="evaluationDetail.stars"></el-rate>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="">
          <span v-for="(item, index) in getTips(evaluationDetail.tips)" :key="index"><el-tag v-if="item">{{item}}</el-tag>&nbsp;</span>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="">
          {{evaluationDetail.memo}}
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <upload-image :formData="{}" :value="getImage(evaluationDetail.pictures)" :readonly="true"></upload-image>
      </el-col>
    </el-row>
    </el-form>
  </Portlet>
</template>
<script>
import {getImage} from '@/utils'
export default {
  name: 'goods',
  components: {
  },
  data() {
    return {
    }
  },
  filters: {
  },
  props: {
    id: {
      type: String,
      default: ''
    },
    evaluationDetail: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  computed: {
  },
  created() {
  },
  methods: {
    getImage,
    getTips(tips) {
      if (Array.isArray(tips)) {
        return tips
      }
      if (tips && typeof tips === 'string') {
        return tips.split(',')
      }
      return []
    }
  }
}
</script>
